<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../../Templates/SubFolderTemplate.xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <ui:define name="head-title">
        <title>View Product Batch | Merlion's ERP System</title>
    </ui:define>

    <ui:define name="content">
        <p:panel id="panel" header="View Product Batch">
            <h:form prependId="false">
                <p:dataTable var="productBatch" value="#{viewProductBatchManagerBean.productBatch}" 
                             dynamic="true" paginator="true" rows="5" emptyMessage="No Product Batch Record." selection="#{viewProductBatchManagerBean.selectedProductBatch}" onRowSelectUpdate="display"> 
                    <p:column selectionMode="single"/>
                    <p:column sortBy="#{productBatch.id}" filterBy="#{productBatch.id}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Batch ID" /> 
                        </f:facet> 
                        <h:outputText value="#{productBatch.id}" /> 
                    </p:column> 

                    <p:column sortBy="#{productBatch.batchDate}" filterBy="#{productBatch.batchDate}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Batch Date" /> 
                        </f:facet> 
                        <h:outputText value="#{productBatch.batchDate}" /> 
                    </p:column> 



                    <p:column sortBy="#{productBatch.product.productType}" filterBy="#{productBatch.product.productType}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Product Type" /> 
                        </f:facet> 
                        <h:outputText value="#{productBatch.product.productType}" /> 
                    </p:column>

                    <p:column sortBy="#{productBatch.quantity}" filterBy="#{productBatch.quantity}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Quantity" /> 
                        </f:facet> 
                        <h:outputText value="#{productBatch.quantity}" /> 
                    </p:column>

                    <p:column sortBy="#{productBatch.expiryDate}" filterBy="#{productBatch.expiryDate}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Expiry Date" /> 
                        </f:facet> 
                        <h:outputText value="#{productBatch.expiryDate}" /> 
                    </p:column>

                    <p:column sortBy="#{productBatch.location}" filterBy="#{productBatch.location}"> 
                        <f:facet name="header"> 
                            <h:outputText value="Location" /> 
                        </f:facet> 
                        <h:outputText value="#{productBatch.location}" /> 
                    </p:column>

                    <f:facet name="footer"/>                    

                </p:dataTable>
            </h:form>
        </p:panel>
    </ui:define>

</ui:composition>
